import java.util.ArrayDeque;
import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;

public class Test1 {
    public static void main5(String[] args) {
        MyStackusequeue stack = new MyStackusequeue();
        stack.push(11);
        stack.push(12);
        stack.push(13);
        stack.push(14);
        stack.pop();
        int a = stack.top();
    }
    public static void main4(String[] args) {
        Deque<Integer> stack = new LinkedList<>();//双端队列的链式实现
        Deque<Integer> queue = new ArrayDeque<>();//双端队列的线性实现
    }
    public static void main3(String[] args) {
        MyCircularQueue myCircularQueue = new MyCircularQueue(8);
        myCircularQueue.enQueue(11);
        myCircularQueue.enQueue(12);
        myCircularQueue.enQueue(13);
        myCircularQueue.enQueue(14);
        myCircularQueue.enQueue(15);
        System.out.println(myCircularQueue.isFull());

    }
    public static void main2(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.offer(11);//添加元素到队尾
        myQueue.offer(12);
        myQueue.offer(13);
        myQueue.offer(14);
        myQueue.offer(15);
        System.out.println(myQueue.poll());
    }
    public static void main1(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(11);//添加元素到队尾
        queue.offer(12);
        queue.offer(13);
        queue.offer(14);
        queue.offer(15);
        System.out.println(queue);//打印队列  [11, 12, 13, 14, 15]

        int a1 = queue.poll();//移除头元素,并返回
        System.out.println(a1);//11
        System.out.println(queue);//[12, 13, 14, 15]
        int a2 = queue.peek();//获取队头元素
        System.out.println(a2);//12
    }
}
